const tokens = {}
module.exports = [{
    url: '/api/login',
    type: 'post',
    response: (req, res) => {
        const { username, password } = req.body
        console.log('/api/login')
        if (username === 'admin') {
            return {
                code: 0,
                data: {
                    token: Date.now().toString(),
                    user: {
                        name: 'xxx',
                        routes: ['module1-child1', 'module2-child1', 'module2-child2']
                    }
                }
            }
        } else {
            res.status(401)
            return {
                code: 500,
                message: '用户名或密码错误'
            }
        }
    }
}]